package com.wangshouyu.mp.pay.order;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 查询订单结果
 * @date 2020/8/13 14:27
 */
@XStreamAlias(value = "xml")
public class QueryOrderResponse implements Serializable {

    /**
     * 返回码
     */
    @XStreamAlias(value = "return_code")
    private String returnCode;

    /**
     * 返回消息
     */
    @XStreamAlias(value = "return_msg")
    private String returnMsg;

    /**
     * 业务结果
     * SUCCESS/FAIL
     */
    @XStreamAlias(value = "result_code")
    private String resultCode;

    /**
     * 对业务结果的补充说明
     */
    @XStreamAlias(value = "result_msg")
    private String resultMsg;

    /**
     * 错误代码
     * 当result_code为FAIL时返回错误代码
     */
    @XStreamAlias(value = "err_code")
    private String errCode;

    /**
     * 错误代码描述
     */
    @XStreamAlias(value = "err_code_des")
    private String errCodeDes;

    /**
     * 公众账号ID
     * 微信支付分配的公众账号ID（企业号corpid即为此appId）
     */
    @XStreamAlias(value = "appid")
    private String appId;

    /**
     * 商户号
     * 微信支付分配的商户号
     */
    @XStreamAlias(value = "mch_id")
    private String mchId;

    /**
     * 随机字符串
     * 随机字符串，不长于32位。
     */
    @XStreamAlias(value = "nonce_str")
    private String nonceStr;

    /**
     * 签名
     */
    @XStreamAlias(value = "sign")
    private String sign;

    /**
     * 设备号
     */
    @XStreamAlias(value = "device_info")
    private String deviceInfo;

    /**
     * 用户openId
     */
    @XStreamAlias(value = "openid")
    private String openId;

    /**
     * 是否关注公众账号
     * Y-关注，N-未关注
     */
    @XStreamAlias(value = "is_subscribe")
    private String isSubscribe;

    /**
     * 交易类型
     * JSAPI -JSAPI支付
     * NATIVE -Native支付
     * APP -APP支付
     */
    @XStreamAlias(value = "trade_type")
    private String tradeType;

    /**
     * 交易状态
     * SUCCESS—支付成功
     * REFUND—转入退款
     * NOTPAY—未支付
     * CLOSED—已关闭
     * REVOKED—已撤销（付款码支付）
     * USERPAYING--用户支付中（付款码支付）
     * PAYERROR--支付失败(其他原因，如银行返回失败)
     */
    @XStreamAlias(value = "trade_state")
    private String tradeState;

    /**
     * 付款银行
     */
    @XStreamAlias(value = "bank_type")
    private String bankType;

    /**
     * 标价币种
     */
    @XStreamAlias(value = "total_fee")
    private Integer totalFee;

    /**
     * 应结订单金额
     * 应结订单金额=订单金额-免充值优惠券金额。
     */
    @XStreamAlias(value = "settlement_total_fee")
    private Integer settlementTotalFee;

    /**
     * 标价币种
     */
    @XStreamAlias(value = "fee_type")
    private String feeType;

    /**
     * 现金支付金额
     */
    @XStreamAlias(value = "cash_fee")
    private Integer cashFee;

    /**
     * 现金支付币种
     */
    @XStreamAlias(value = "cash_fee_type")
    private String cashFeeType;

    /**
     * 代金券金额
     */
    @XStreamAlias(value = "coupon_fee")
    private Integer couponFee;

    /**
     * 代金券使用数量
     */
    @XStreamAlias(value = "coupon_count")
    private Integer couponCount;

    /**
     * 商户订单号
     */
    @XStreamAlias(value = "out_trade_no")
    private String outTradeNo;

    /**
     * 微信支付订单号
     */
    @XStreamAlias(value = "transaction_id")
    private String transactionId;

    /**
     * 附加数据
     */
    @XStreamAlias(value = "attach")
    private String attach;

    /**
     * 支付完成时间
     */
    @XStreamAlias(value = "time_end")
    private String timeEnd;

    /**
     * 交易状态描述
     */
    @XStreamAlias(value = "trade_state_desc")
    private String tradeStateDesc;

    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getErrCodeDes() {
        return errCodeDes;
    }

    public void setErrCodeDes(String errCodeDes) {
        this.errCodeDes = errCodeDes;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getDeviceInfo() {
        return deviceInfo;
    }

    public void setDeviceInfo(String deviceInfo) {
        this.deviceInfo = deviceInfo;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getIsSubscribe() {
        return isSubscribe;
    }

    public void setIsSubscribe(String isSubscribe) {
        this.isSubscribe = isSubscribe;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public String getTradeState() {
        return tradeState;
    }

    public void setTradeState(String tradeState) {
        this.tradeState = tradeState;
    }

    public String getBankType() {
        return bankType;
    }

    public void setBankType(String bankType) {
        this.bankType = bankType;
    }

    public Integer getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(Integer totalFee) {
        this.totalFee = totalFee;
    }

    public Integer getSettlementTotalFee() {
        return settlementTotalFee;
    }

    public void setSettlementTotalFee(Integer settlementTotalFee) {
        this.settlementTotalFee = settlementTotalFee;
    }

    public String getFeeType() {
        return feeType;
    }

    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }

    public Integer getCashFee() {
        return cashFee;
    }

    public void setCashFee(Integer cashFee) {
        this.cashFee = cashFee;
    }

    public String getCashFeeType() {
        return cashFeeType;
    }

    public void setCashFeeType(String cashFeeType) {
        this.cashFeeType = cashFeeType;
    }

    public Integer getCouponFee() {
        return couponFee;
    }

    public void setCouponFee(Integer couponFee) {
        this.couponFee = couponFee;
    }

    public Integer getCouponCount() {
        return couponCount;
    }

    public void setCouponCount(Integer couponCount) {
        this.couponCount = couponCount;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    public String getTimeEnd() {
        return timeEnd;
    }

    public void setTimeEnd(String timeEnd) {
        this.timeEnd = timeEnd;
    }

    public String getTradeStateDesc() {
        return tradeStateDesc;
    }

    public void setTradeStateDesc(String tradeStateDesc) {
        this.tradeStateDesc = tradeStateDesc;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        QueryOrderResponse that = (QueryOrderResponse) o;
        return Objects.equals(returnCode, that.returnCode) &&
                Objects.equals(returnMsg, that.returnMsg) &&
                Objects.equals(resultCode, that.resultCode) &&
                Objects.equals(resultMsg, that.resultMsg) &&
                Objects.equals(errCode, that.errCode) &&
                Objects.equals(errCodeDes, that.errCodeDes) &&
                Objects.equals(appId, that.appId) &&
                Objects.equals(mchId, that.mchId) &&
                Objects.equals(nonceStr, that.nonceStr) &&
                Objects.equals(sign, that.sign) &&
                Objects.equals(deviceInfo, that.deviceInfo) &&
                Objects.equals(openId, that.openId) &&
                Objects.equals(isSubscribe, that.isSubscribe) &&
                Objects.equals(tradeType, that.tradeType) &&
                Objects.equals(tradeState, that.tradeState) &&
                Objects.equals(bankType, that.bankType) &&
                Objects.equals(totalFee, that.totalFee) &&
                Objects.equals(settlementTotalFee, that.settlementTotalFee) &&
                Objects.equals(feeType, that.feeType) &&
                Objects.equals(cashFee, that.cashFee) &&
                Objects.equals(cashFeeType, that.cashFeeType) &&
                Objects.equals(couponFee, that.couponFee) &&
                Objects.equals(couponCount, that.couponCount) &&
                Objects.equals(outTradeNo, that.outTradeNo) &&
                Objects.equals(transactionId, that.transactionId) &&
                Objects.equals(attach, that.attach) &&
                Objects.equals(timeEnd, that.timeEnd) &&
                Objects.equals(tradeStateDesc, that.tradeStateDesc);
    }

    @Override
    public int hashCode() {
        return Objects.hash(returnCode, returnMsg, resultCode, resultMsg, errCode, errCodeDes, appId, mchId, nonceStr, sign, deviceInfo, openId, isSubscribe, tradeType, tradeState, bankType, totalFee, settlementTotalFee, feeType, cashFee, cashFeeType, couponFee, couponCount, outTradeNo, transactionId, attach, timeEnd, tradeStateDesc);
    }

    @Override
    public String toString() {
        return "QueryOrderResponse{" +
                "returnCode='" + returnCode + '\'' +
                ", returnMsg='" + returnMsg + '\'' +
                ", resultCode='" + resultCode + '\'' +
                ", resultMsg='" + resultMsg + '\'' +
                ", errCode='" + errCode + '\'' +
                ", errCodeDes='" + errCodeDes + '\'' +
                ", appId='" + appId + '\'' +
                ", mchId='" + mchId + '\'' +
                ", nonceStr='" + nonceStr + '\'' +
                ", sign='" + sign + '\'' +
                ", deviceInfo='" + deviceInfo + '\'' +
                ", openId='" + openId + '\'' +
                ", isSubscribe='" + isSubscribe + '\'' +
                ", tradeType='" + tradeType + '\'' +
                ", tradeState='" + tradeState + '\'' +
                ", bankType='" + bankType + '\'' +
                ", totalFee=" + totalFee +
                ", settlementTotalFee=" + settlementTotalFee +
                ", feeType='" + feeType + '\'' +
                ", cashFee=" + cashFee +
                ", cashFeeType='" + cashFeeType + '\'' +
                ", couponFee=" + couponFee +
                ", couponCount=" + couponCount +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", transactionId='" + transactionId + '\'' +
                ", attach='" + attach + '\'' +
                ", timeEnd='" + timeEnd + '\'' +
                ", tradeStateDesc='" + tradeStateDesc + '\'' +
                '}';
    }
}
